# -*- coding:utf-8 -*-
import bottle
from bottle import route, run, request,  template

#模板的使用

@route('')
@route('/')
def index():
  #引用views下模板,加上模板名就可以了，不要添加后缀
  return template('index')
@route('/login',method='post')
def login():
  username = request.forms.get('username')
  password = request.forms.get('password')


  #将数据存入模板中
  return template('login',username=username,password=password)


if __name__  == '__main__':
  run(host='0.0.0.0',port='8080')
else:
  application = bottle.default_app()

